use actix_web::{Path, FromRequest, HttpRequest};

pub fn get_user_info(req: &HttpRequest) -> String {
    let name = Path::<String>::extract(req).unwrap_or(Path::from("Unknown User".to_owned())).into_inner();

    format!("GET/Hello {},\nhere is your request:{:?}", name, req)
}

pub fn set_user_info(req: &HttpRequest) -> String {
    let name = Path::<String>::extract(req).unwrap_or(Path::from("Unknown User".to_owned())).into_inner();

    format!("POST/Hello {},\nhere is your request:{:?}", name, req)
}